Skip to main content

GCP CLI Reference

Configure CLI SSO

What you'll need

  1. Install AWS CLI with the default options enabled (make sure 'Bundled Python' is enabled)

Setup

  1. Run initial CLI init by running gcloud init from terminal (follow the configuration manual if needed). When prompted after signing in, choose 'backend-me-west1' as the default project
  2. Configure local default credentials by running gcloud auth application-default login from terminal (follow the configuration manual if needed)
Addition steps for Windows only

To allow running local backend in docker against GCP backend a few additional steps are needed:

  • Move GCP CLI credentials folder from appdata to user dir, to align with paths on Mac and Linux:
    setx CLOUDSDK_CONFIG "${env:HOME}${env:USERPROFILE}\.config\gcloud"
    mkdir $env:CLOUDSDK_CONFIG -Force
  • If GCP CLI was already authenticated before in the default path, force it to regenerate by running:
    gcloud auth revoke --all
    gcloud auth login

    gcloud auth application-default revoke
    gcloud auth application-default login

Additional info

After the initial setup, when needing to refresh credentials run the following commands:

gcloud auth login
gcloud auth application-default login

Note: both commands have to be run